package com.clstu.string;

public class StringExcercise03 {
    public static void main(String[] args) {
        String s1="hello";
        String s2="abc";
        String s3="hello"+"abc";//先拼接再创建对象，相当于String s3 = "helloabc";
        String s4="helloabc";
        String s5=s1+s2;//指向堆，堆中的value指向helloabc
                                // 1.StringBuider sb = new StringBuider();
//                                 2.sb.append("hello");
//                                 3.sb.append("abc")
//                                4.String s4=sb.toString();
    //
        System.out.println(s3==s4);//true
        System.out.println(s3==s5);//false
    }
}
